<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<!-- 新 Bootstrap 核心 CSS 文件 -->
	<link href="static/css/bootstrap.min.css" rel="stylesheet" />
	<!-- 可选的Bootstrap主题文件（一般不用引入） -->
	<link rel="stylesheet" href="static/css/bootstrap-theme.min.css">
	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script type="text/javascript" src="static/js/jquery-1.8.3.js"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script type="text/javascript"  src="static/js/bootstrap.min.js"></script>
  </head>
  
  <body>
  <div style="text-align: center; "><h2 style="font-weight: bolder; ">学生信息管理平台</h2></div><br/>
   <table class="table table-hover">
   <tr>
				<td>姓名</td>
				<td>年龄</td>
				<td>性别</td>
				<td>电话</td>
				<td>地址</td>
				<td>生日</td>
				<td>操作	</td>
				<td><a href="add.jsp" class="btn btn-primary btn-xs" role="button">添加</a></td>
		</tr>
   <c:forEach items="${stulist }" var="stu">
  		<tr>
				<td>${stu.name }</td>
				<td>${stu.age }</td>
				<td>${stu.sex }</td>
				<td>${stu.tel }</td>
				<td>${stu.address }</td>
				<td>${stu.birthday }</td>
				<td><a href="update.s?id=${stu.id }&currentPage=${page.currentPage }" class="btn btn-primary btn-xs" role="button">修改</a></td>
				<td><a href="delStudent.s?id=${stu.id }&currentPage=${page.currentPage }" class="btn btn-primary btn-xs" role="button">删除</a>
				</td>
		</tr>
   </c:forEach>
   </table>
   <div style="width: 500px; margin-left: 500px;">
  <ul class="pagination" >
  	<li><a href="selStudent.s?currentPage=1">首页</a></li>
  <c:if test="${page.currentPage<=1 }">
  	<li class="disabled"><a href="#">上一页</a></li>
  </c:if>
    <c:if test="${page.currentPage>1 }">
    	<li><a href="selStudent.s?currentPage=${page.currentPage-1 }">上一页</a></li>
    </c:if>
    <li><a href="#">...</a></li>
    <li class="active"><a href="#">${page.currentPage }</a></li>
    <li><a href="#">...</a></li>
    <c:if test="${page.currentPage>=page.totalPage }">
    	<li class="disabled"><a href="#">下一页</a></li>
    </c:if>
    <c:if test="${page.currentPage<page.totalPage }">
    	<li><a href="selStudent.s?currentPage=${page.currentPage+1 }">下一页</a></li>
    </c:if>
    	<li><a href="selStudent.s?currentPage=${page.totalPage }">尾页</a></li>
  </ul>
  </div>
  </body>
</html>
